<div class="wrap">
    <div id="icon-options-general" class="icon32"><br></div>
    <h2 class="nav-tab-wrapper">
        <a href="{link target='self:defaultAction'}" class="nav-tab">Obecné</a>
        <a href="{link target='self:userSettings'}" class="nav-tab nav-tab-active">Oprávnění</a>
    </h2>
    {include file="messages.tpl"}
    <div id="post-body">
        <div id='poststuff'>
            <br/>
            <form action="{link target='self:updateUserSettings'}" id="form_updateUserRights" method="post">
                <div id="linkcategorydiv" class="postbox">
                    <h3><span>Oprávnění k datovým zdrojům</span></h3>
                    <div class="inside">
                        <ul class="category-tabs">
                            {foreach $users as $user}
                            {if $user->ID == $userId}
                            <li class="tabs"><b>{$user->user_nicename|escape}</b></li>
                            {else}
                            <li><a href="{link target='self:userSettings' userId=$user->ID}">{$user->user_nicename|escape}</a></li>
                            {/if}
                            {/foreach}
                        </ul>
                        <div class="tabs-panel">                       
                            <input type="hidden" name="userId" value="{$userId|escape}" />
                            <table class="user-rights">
                                <thead>
                                <th></th>
<!--                                <th>Zápis</th>-->
                                <th>Čtení</th>
<!--                                <th>Aktualizace</th>-->
<!--                                <th>Odstranění</th>-->
                                </thead>
                                <tbody>
                                    {foreach $sources as $source}
                                    <tr>
                                        <td>{$source.name}</td>
<!--                                        <td>
                                            <input type="checkbox" value="C" name="hasRight[{$source.sourceId}][]"{if $userRights[$source.sourceId]['C'] == true} checked="checked"{/if} />
                                        </td>-->
                                        <td>
                                            <input type="checkbox" value="R" name="hasRight[{$source.sourceId}][]"{if $userRights[$source.sourceId]['R'] == true} checked="checked"{/if} />
                                        </td>
<!--                                        <td>
                                            <input type="checkbox" value="U" name="hasRight[{$source.sourceId}][]"{if $userRights[$source.sourceId]['U'] == true} checked="checked"{/if} />
                                        </td>
                                        <td>
                                            <input type="checkbox" value="D" name="hasRight[{$source.sourceId}][]"{if $userRights[$source.sourceId]['D'] == true} checked="checked"{/if} />
                                        </td>-->
                                    </tr>
                                    {/foreach}
                                </tbody>
                                <tfoot>
                                <th></th>
<!--                                <th>Zápis</th>-->
                                <th>Čtení</th>
<!--                                <th>Aktualizace</th>
                                <th>Odstranění</th>-->
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
                <input type="submit" name="submit" id="submit" class="button-primary" value="Uložit změny">
            </form>
        </div>
    </div>        
</div>
